package com.jing.weibo.service.info;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.jing.weibo.mapper.info.InfoTypeMapper;
import com.jing.weibo.pojo.info.InfoType;

/**
 * 信息类型的Service
 * @author jing.yue
 * @version 2012/09/25 1.0.0
 */
@Component
public class InfoTypeService {

	@Autowired
	private InfoTypeMapper infoTypeMapper;

	/**
	 * 获取所有信息类型列表
	 * @return
	 * @throws Exception
	 */
	public List<InfoType> findAllInfoType() throws Exception {
		return infoTypeMapper.findAllInfoType();
	}

	/**
	 * 获取信息类型列表
	 * @param info
	 * @return
	 * @throws Exception
	 */
	public List<InfoType> findInfoType(InfoType infoType) throws Exception {
		return infoTypeMapper.findInfoType(infoType);
	}

	/**
	 * 添加信息类型
	 * @param infoType
	 * @throws Exception
	 */
	public void saveInfoType(InfoType infoType) throws Exception {
		infoTypeMapper.saveInfoType(infoType);
	}

	/**
	 * 获取一级信息类型
	 * @return
	 * @throws Exception
	 */
	public List<InfoType> findParentInfoType() throws Exception {
		return infoTypeMapper.findParentInfoType();
	}

	/**
	 * 修改信息类型
	 * @param infoType
	 * @throws Exception
	 */
	public void updateInfoType(InfoType infoType) throws Exception {
		infoTypeMapper.updateInfoType(infoType);
	}
}
